﻿#ifndef BLOCK_H
#define BLOCK_H

/********************************************************
 * @ClassName:  Block
 * @Brief:      管理单个方块特性
 * @date        2021/12/28
 ********************************************************/
#include <QGraphicsObject>

class Block : public QGraphicsObject
{
public:
    Block(const QColor &brushColor = Qt::red);

    QRectF boundingRect() const override;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
    QPainterPath shape() const override;

    void setCoord(int x, int y);        //设置坐标

private:
    QColor m_brushColor;
};

#endif // BLOCK_H
